<template>
	<view class="contract-base-info">
		<!-- 姓名 -->
		<view class="username cell-item">
			<view>票据编号</view>
			<view class="right-content">{{expenseEntity.documentNumber||'--'}}</view>
		</view>
		<view class="email cell-item">
			<view>报销类型</view>
			<view class="right-content">{{expenseEntity.expenseType==1?'出差报销' : '采购报销'}}</view>
		</view>
		<view class="email cell-item">
			<view>报销金额</view>
			<view class="right-content">{{expenseEntity.amount==null?'--':'￥'+expenseEntity.amount}}</view>
		</view>
		<!-- 手机号 -->
		<view class="telPhone cell-item">
			<view>所属项目</view>
			<view class="right-content">{{expenseEntity.projectName||'--'}}</view>
		</view>
		<view class="role cell-item">
			<view>报销人</view>
			<view class="right-content">{{expenseEntity.expenseUserName||'--'}}</view>
		</view>
		<view class="role cell-item">
			<view>开户行</view>
			<view class="right-content">{{expenseEntity.bank||'--'}}</view>
		</view>
		<view class="role cell-item">
			<view>银行账号</view>
			<view class="right-content">{{expenseEntity.bankAccount||'--'}}</view>
		</view>
		<view class="email cell-item">
			<view>付款摘要</view>
			<view class="right-content">{{expenseEntity.abstractInfo}}</view>
		</view>
		<!-- 商家名称 -->
		<view class="regitster-info cell-item">
			<view>工号</view>
			<view class="right-content">{{expenseEntity.projectName}}
			</view>
		</view>
		<!-- 商家地区 -->
		<view class="regitster-info cell-item">
			<view>录入人</view>
			<view class="right-content">{{expenseEntity.userName}}
			</view>
		</view>
		<view class="regitster-info cell-item">
			<view>开始日期</view>
			<view class="right-content">
				<uni-dateformat v-if='expenseEntity.startTime' :date="expenseEntity.startTime"
					format='yyyy-MM-dd'></uni-dateformat>
				<text v-else>--</text>
			</view>
		</view>
		<view class="regitster-info cell-item">
			<view>结束日期</view>
			<view class="right-content">
				<uni-dateformat :date="expenseEntity.endTime" v-if='expenseEntity.endTime'
					format='yyyy-MM-dd'></uni-dateformat>
				<text v-else>--</text>
			</view>
		</view>
		<view class="regitster-info cell-item">
			<view>审批状态</view>
			<view class="right-content">
				{{ expenseEntity.status == 0 ? '未审批' : (expenseEntity.status == 1 ? '审批中' : '已审批') }}
			</view>
		</view>
		<view class="regitster-info cell-item" style="border-bottom: none;">
			<view>备注</view>
			<view class="right-content">{{expenseEntity.remark||'--'}}</view>
		</view>
	</view>
</template>

<script>
	import {
		api,
		post
	} from '@/util/api.js'
	export default {
		props: {
			id: '',
		},
		data() {
			return {
				expenseEntity: {}
			}
		},
		created() {
			this.querySingle()
		},
		methods: {
			querySingle() {
				post(api.ExpenseSingle, {
					id: this.id
				}).then(res => {
					this.expenseEntity = res.data
				})
			}
		}
	}
</script>

<style>
	@import '../../static/css/ExpenseBaseInfo.css';
</style>